<?php
/**
 * Class implementing the
 * <a href="http://www.martinfowler.com/eaaCatalog/rowDataGateway.html">Table Data Gateway pattern</a>
 * to access admin table
 */
class CarouselItem extends BaseRow
{
    public function isDiscount()
    {
        return ($this->item_type == 'discount');
    }

    public function isStorePicture()
    {
        return ($this->item_type == 'store_picture');
    }

    /**
     * @param $text
     * @return $this
     */
    public function setText($text)
    {
        $this->item_text = $text;
        return $this;
    }

    /**
     * @param $dateIn
     * @return $this
     */
    public function setDateIn($dateIn)
    {
        $this->date_in = $dateIn;
        return $this;
    }

    /**
     * @param $dateOut
     * @return $this
     */
    public function setDateOut($dateOut)
    {
        $this->date_out = $dateOut;
        return $this;
    }

    public function setType($itemType)
    {
        if ($itemType == 'store') $itemType = 'store_picture';
        $this->item_type = $itemType;

        return $this;
    }
}